package com.neusoft.elmboot.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import com.neusoft.elmboot.mapper.RatingMapper;
import com.neusoft.elmboot.po.Rating;
import com.neusoft.elmboot.service.RatingService;

@Service
public class RatingServiceImpl implements RatingService{
	
	@Autowired
	private RatingMapper ratingMapper;
	
	@Override
	public List<Rating> listRatingsByBusinessId(Integer businessId){
		List<Rating> list=ratingMapper.listRatingsByBisinessId(businessId);
		for(Rating item:list) {
			item.setRecommend(ratingMapper.listRecommendByRatingId(item.getRatingId()));
		}
		return  list;
	}
}
